
package com.cpj.signin.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import java.time.LocalDateTime;

@Data
@Document(collection = "messages")
public class Message {
    @Id
    private String id;
    private String userName;
    private String content;
    private LocalDateTime createTime;

    public Message() {
        this.createTime = LocalDateTime.now();
    }

    public Message(String userName, String content) {
        this();
        this.userName = userName;
        this.content = content;
    }
}
